<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    if (document.compatMode == 'BackCompat'){
        //混杂，只在IE低版下才有
        console.log(document.body.clientHeight);
        console.log(document.body.clientWidth);
    } else {
        //标准
        console.log(document.documentElement.clientHeight);
        console.log(document.documentElement.clientWidth);
    }
</script>
</body>
</html>